<%@ include file="/common/taglibs.jsp"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>" type="text/css" />
	</head>
	<body>
		<div class="head_content" id="headBar"  >
			<div id=" " class="finder-action">
				<div class="finder-action-inner clearfix">
					<button class="btn btn-large" onclick="location.href='<c:url value="gd_specification_add.html" /> '" type="button">
						<span><span><i class="finder-icon"><img style="width: 24px; height: 24px; background-position: 0pt -316px;" class="imgbundle icon"
										src="<c:url value="/images/transparent.gif"/>" /> </i>
							<fmt:message key="gd_specification.add" />
						</span> </span>
					</button>
					<button class="btn" onclick="location.reload()" type="button">
						<span> <span> <i class="finder-icon"> <img style="width: 22px; height: 24px; background-position: 0pt -644px;" class="imgbundle icon"
										src="<c:url value="/images/transparent.gif"/>" /> </i>
							<fmt:message key="button.refresh" /> </span> </span>
					</button>
					<button class="btn" type="button" onclick="delteSpec()">
						<span><span><i class="finder-icon"><img style="width: 17px; height: 24px; background-position: 0pt -757px;" class="imgbundle icon"
										src="<c:url value="/images/transparent.gif"/>" /> </i>
							<fmt:message key="button.delete" />
						</span> </span>
					</button>

				</div>
			</div>

			<div class="finder-header" id="" style="">

				<table width="100%" cellspacing="0" cellpadding="0">
					<!----cols---->
					<col style="width: 10%;" />
					<col style="width: 10%" />
					<col style="width: 10%;" />
					<col style="width: 10%" />
					<col style="width: 10%" />
					<!----cols---->
					<thead>
						<tr>
							<td>
								<span class="finder-col-label"><fmt:message key="gd_specfication.operation" />
								</span>
							</td>
							<td>
								<fmt:message key="button.delete" />
							</td>
							<td>
								<span class="finder-col-label"><fmt:message key="gd_specfication.name" />
								</span>
							</td>
							<td>
								<span class="finder-col-label"><fmt:message key="gd_specfication.type" />
								</span>
							</td>
							<td>
								<span class="finder-col-label"><fmt:message key="gd_specfication.show" />
								</span>
							</td>
							<td>
								&nbsp;
							</td>
						</tr>
					</thead>
				</table>
			</div>
		</div>
		<div class="main_content" id="main" >
			<div   class="finder-list finder-list-normal">
				<table width="100%" cellspacing="0" cellpadding="0" id="tbl_spec">
					<col style="width: 10%;" />
					<col style="width: 10%" />
					<col style="width: 10%;" />
					<col style="width: 10%" />
					<col style="width: 10%" />
					<col />
					<tbody>
						<c:forEach var="list" items="${goodsSpecifications}" varStatus="status1">
							<tr id='spec_${list.specId }' class="row  <c:if test="${status1.index%2 eq 1}">even </c:if>">
								<td class="finder-list-command">
									<a href="<c:url value="gd_specification_edit.html?specId=${list.specId }" />"><img style="width: 15px; height: 16px; background-position: 0pt -133px;" class="imgbundle"
											src="<c:url value="/images/transparent.gif" />" /> <fmt:message key="button.edit" /> </a>

								</td>
								<td onclick="deleteSpec(this,${list.specId });" style="cursor: pointer;">
									<img border="0" style="width: 16px; height: 16px; background-position: 0pt -214px;" class="imgbundle"   src="<c:url value="/images/transparent.gif"/>" />
								</td>
								<td class="editable">
									<div class="cell">
										${list.specName }
									</div>
								</td>
								<td class="editable">
									<div class="cell">										 
										<fmt:message key="gd_specfication.specType${list.specType}" />
									</div>
								</td>
								<td class="editable">
									<div class="cell">
										<fmt:message key="gd_specfication.specShowType${list.specShowType}" />										
									</div>
								</td>
								<td>
									&nbsp;
								</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<div class="finder-list-col-editpanel" style="overflow: hidden;" id="finder-list-col-editpanel"></div>
			</div>

		</div>
		<div class="foot_content" id="footBar"  >
			<div  class="finder-footer">
				<div class="finder-page clearfix">
					<div class="span-3">
					</div>
					<div class="span-auto textright">
						<fmt:message key="public_page.count">
							<fmt:param>
								<i>${fn:length(goodsSpecifications)}</i>
							</fmt:param>
						</fmt:message>
					</div>
				</div>
			</div> 
		</div>


		<script type="text/javascript" src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>
		<%@ include file="/jsp/admin/common/messages.jsp"%>
		<script type="text/javascript">	
			function changeColor(obj,spec_id){			
				if($(obj).attr("checked")){			
					$("#spec_"+spec_id).addClass(selected);					
				}else{	
					$("#spec_"+spec_id).removeClass(selected);
				}		
			}
		
			function deleteSpec(clickedObj,specId){
				if(!confirm('<fmt:message key="common.confirm_deleted" />')){
					return;
				}			
				var url = "gd_specification_delete.html";
				var params = {
					"specId" : specId
				};	
				$.getJSON(url, params, 
					function callback(data) 
					{	var flag = data.successFlag;
						var returnString='';
						if(flag){
							returnString = '<fmt:message key="common.deleted" />';
							$(clickedObj).parent().remove();
						}else{
							returnString ='<fmt:message key="gd_specfication.delete_fail" />'; 
						}
						showCallbackResult(returnString);
					}
				);			
			}
		</script>




	</body>
</html>